const mongoose = require("mongoose")
const ObjectId = mongoose.Schema.Types.ObjectId;
//订单模板
const GoodsOrderSchema = new mongoose.Schema({
    Goods:{
        type:ObjectId,
        ref:"Goods"
    },
    Shop: { //关联的门店
        type: ObjectId,
        ref: "Shop"
    },
    Host: { //关联的宠主
        type: ObjectId,
        ref: "Host"
    },
    sellCount:Number,//销售数量
    orderState: Boolean, //订单状态
}, {

        versionKey: false,
        timestamps: {
            createdAt: 'createTime',
            updatedAt: 'updateTime'
        } //自动管理修改时间
    })

module.exports = mongoose.model("GoodsOrder", GoodsOrderSchema);